home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
B-Book Series
/
(k)b2.d64
/
report
< prev
next >
Wrap
Text File
|
2007-02-28
|
3KB
|
111 lines
0010 //OLDHAM'S GRAMMAR SCHOOL//
0020 //PROGRAM TO ADMINISTER PUPILS' MARKS//
0030 //WRITTEN IN CBM COMAL-80//
0040 //THIS VERSION: OCT. 1981//
0050 //THIS PART: TO PRINT REPORTS//
0060 //
0070 MAX:=8
0080 DIM NAME$(MAX) OF 20, ANSW$ OF 10
0090 DIM THISNAME$ OF 20
0100 DIM MARK(MAX,3), SUBJ$(3) OF 11, KEY'(MAX)
0110 DIM SPACES$ OF 39
0120 //*
0130 SUBJ$(1):="ENGLISH"
0140 SUBJ$(2):="MATHEMATICS"
0150 SUBJ$(3):="FRENCH"
0160 SPACES$(1:39):=""
0190 //
0200 STARTSYSTEM
0210 //
0220 //* MAINLINES *//
0230 PRINT CHR$(147) //CLEAR SCREEN
0240 FIELD(8,15)
0250 PRINT "1=SCREEN"
0260 PRINT "2=PRINTER"
0270 PRINT
0280 INPUT "> ": DEVICE
0290 GETPERIOD
0300 IF DEVICE=2 THEN SELECT OUTPUT "LP:"
0310 PRINTOUT
0320 IF DEVICE=2 THEN SELECT OUTPUT "DS:"
0330 PRINT "END OF PROGRAM: REPORT"
0340 //
0350 PROC FIELD(L1,L2)
0360 CURSOR(L1,1)
0370 FOR I:=1 TO L2-L1+1 DO PRINT SPACES$
0380 CURSOR(L1,1)
0390 PRINT
0400 ENDPROC FIELD
0410 //
0420 PROC CURSOR(ROW,COL) CLOSED
0430 PRINT CHR$(19) //HOME
0440 FOR I:=1 TO ROW DO PRINT //DOWN
0445 FOR I:=1 TO COL-1 DO PRINT CHR$(29) //DOWN
0450 ENDPROC CURSOR
0460 //
0470 PROC STARTSYSTEM
0480 OPEN FILE 2,"MARKBOOKS",READ
0490 FOR PUPILNO:=1 TO MAX DO
0500 READ FILE 2: NAME$(PUPILNO)
0510 FOR SUBJNO:=1 TO 3 DO
0520 READ FILE 2: MARK(PUPILNO,SUBJNO)
0530 ENDFOR SUBJNO
0540 ENDFOR PUPILNO
0550 CLOSE
0560 ENDPROC STARTSYSTEM
0570 //
0580 PROC GETPERIOD
0590 PRINT CHR$(147)
0600 FIELD(8,10)
0610 REPEAT
0620 REPEAT
0630 INPUT "WHAT TERM: ": TERM;
0640 UNTIL 0<TERM AND TERM<5
0650 TERM:=INT(TERM)
0660 REPEAT
0670 INPUT "WHAT YEAR: ": YEAR
0680 UNTIL 0<YEAR AND YEAR<99
0690 YEAR:=INT(YEAR)
0700 FIELD(8,15)
0710 PRINT "YOU HAVE ENTERED: ",
0720 PRINT TERM,". TERM, 19",YEAR
0730 INPUT "OK (YES/NO)? ": ANSW$
0740 UNTIL ANSW$="YES"
0750 ENDPROC GETPERIOD
0760 //
0770 PROC PRINTOUT
0780 PRINT CHR$(147)
0790 FOR PUPILNO:=1 TO MAX DO
0800 IF NAME$(PUPILNO)<>"" THEN
0810 THISNAME$:=NAME$(PUPILNO)
0820 IF DEVICE=1 THEN
0830 FIELD(8,20)
0840 ELSE
0850 FOR I:=1 TO 8 DO PRINT
0860 ENDIF
0870 REPORT
0880 ENDIF
0890 PRINT
0900 ENDFOR PUPILNO
0910 PRINT CHR$(147)
0920 ENDPROC PRINTOUT
0930 //
0940 PROC REPORT
0950 PRINT " OLDHAMS'S GRAMMAR SCHOOL"
0960 PRINT " ------------------------"
0970 PRINT "IN THE ",TERM,". TERM OF 19",YEAR
0980 PRINT "PUPIL NUMBER ",PUPILNO,", ",THISNAME$
0990 PRINT "HAS ACHIEVED THE FOLLOWING RESULTS:"
1000 PRINT
1010 ZONE 30
1020 FOR SUBJNO:=1 TO 3 DO
1030 PRINT SUBJ$(SUBJNO),
1040 PRINT MARK(PUPILNO,SUBJNO)
1050 ENDFOR SUBJNO
1060 IF DEVICE=1 THEN
1070 FIELD(18,18)
1080 INPUT "PRESS RETURN ": ANSW$
1090 ENDIF
1100 ZONE 0
1110 ENDPROC REPORT